#
# Data processing configuration module
#

# Note that this file is part of the distribution and thus may change 
# we recommed that you make a copy of this file and use that for your work

# 
# attributes that must be present are capitalized
# 
import atlas
from atlas import util


root = 'NIMBRAT'
tag  = 'kevin'
organism = 'yeast'
SIGMA = 15
EXCLUSION_ZONE = 30
currdir = util.getdir( __file__ )

#
# turn various execution steps on or off
#
LOADER_ENABLED    = 0
FITTER_ENABLED    = True
PREDICTOR_ENABLED = True
EXPORTER_ENABLED  = True

# specifies the data file format parser
from mod454.loader import loader as LOADER

# specifies the data fitter
from mod454.fitter import fitter as FITTER

# specifies the data predictor
from mod454.predictor import predictor as PREDICTOR

# specfies the data exporter
from atlas.commands import exporter as EXPORTER

#
# directory setup, a string containing the 
# full path to a directory 
# currently set to the default home
home = atlas.ENV.HOME_DIR 

#
# overwrite existing lables
#
CLOBBER = True

#
# input data comes from this file
#

DATA_FILE = currdir + "/data/NIMBRAT-1.txt"

#
# setting up various database locators 
#
HDF_DATABASE = "%s/db/%s-%s.hdf" % (home, tag, organism)
SQL_URI = "sqlite:///%s/db/%s-%s.sqlite" % (home, tag, organism)

#
# the size of the data vector (keep it less than 10 million)
#
DATA_SIZE = 10**6

#
# minimum peak height (larger values make for fewer data points)
#
MINIMUM_PEAK_SIZE = 0.1

#
# fitting width that the fitting function is computed over
#
WIDTH = SIGMA * 5

#
# labels for data, fitted data and peaks
#
DATA_LABEL = root
FIT_LABEL  = "%s-SIGMA-%s" % (DATA_LABEL, SIGMA)
PEAK_LABEL = "PRED-%s" % FIT_LABEL

#
# the full interval relative to the maxima
#
LEFT_SHIFT  = EXCLUSION_ZONE/2
RIGHT_SHIFT = EXCLUSION_ZONE/2

#
# data export 
#
EXPORT_LABELS  = [ PEAK_LABEL ]
EXPORT_DIR     = home + "/html/static/download"

if 0:
    from atlas import sql
    feature_file =  home + "/data/yeast-features.txt"
    sql.load_features( SQL_URI, feature_file, clobber=False, drop=False )

    #loads nimblegen data
    for i in range(1,6):
        feature_file =  currdir + "/data/NIMB-%d.txt" % i
        sql.load_features( SQL_URI, feature_file, clobber=False, drop=False )
